import { defineStore } from 'pinia'
export const useAreaInfoStore = defineStore('area', {
  state: () => {
    return {
        areaInfo: JSON.parse(sessionStorage.getItem('areaInfo')) || "",
        areaRolesInfo: JSON.parse(sessionStorage.getItem('areaRolesInfo')) || "",
    }
  },
  actions:{
    getAreaInfo(){
       
    },
    setAreaInfo(log){
      this.areaInfo = log;
    //   console.log(this.areaInfo,'areaInfo');
      sessionStorage.setItem(`areaInfo`, JSON.stringify(log))
    },
    removeAeraInfo(){
      this.distInfo = "";
      sessionStorage.removeItem(`areaInfo`)
    },


    setAreaRolesInfo(log){
      this.areaRolesInfo = log;
    //   console.log(this.areaInfo,'areaInfo');
      sessionStorage.setItem(`areaRolesInfo`, JSON.stringify(log))
    },
    removeAeraRolesInfo(){
      this.distInfo = "";
      sessionStorage.removeItem(`areaRolesInfo`)
    },
  },
  getters:{
    AreaInfo(){
        // console.log(this.areaInfo,'areaInfo');
        return this.areaInfo;
    },
    AreaRolesInfo(){
      // console.log(this.areaInfo,'areaInfo');
      return this.areaRolesInfo;
  },
  }
})

